﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Entities;

namespace QuanLyTKB_TienDoGD.In
{
    public partial class frmInDanhSachGiaoVien : Form
    {
        public frmInDanhSachGiaoVien()
        {
            InitializeComponent();
        }

        private void frmInDanhSachGiaoVien_Load(object sender, EventArgs e)
        {

            this.reportViewerDanhSachGV.RefreshReport();
        }

        private void reportViewerDanhSachGV_Load(object sender, EventArgs e)
        {
            List<GiaoVien> ds = GiaoVien.Repository.GetAll().ToList();
            reportViewerDanhSachGV.LocalReport.DataSources.Clear();
            reportViewerDanhSachGV.LocalReport.ReportEmbeddedResource = "QuanLyTKB_TienDoGD.In.ReportDSGiaoVien.rdlc";
            Microsoft.Reporting.WinForms.ReportDataSource dataset = new Microsoft.Reporting.WinForms.ReportDataSource("GiaoVien", ds);
            reportViewerDanhSachGV.LocalReport.DataSources.Add(dataset);
            dataset.Value = ds;
            reportViewerDanhSachGV.ZoomMode = Microsoft.Reporting.WinForms.ZoomMode.PageWidth;
            reportViewerDanhSachGV.LocalReport.Refresh();
            reportViewerDanhSachGV.RefreshReport();
            this.reportViewerDanhSachGV.RefreshReport();
            
        }
    }
}
